package com.keqiongzc.specialcar.viewmodel.request

import androidx.lifecycle.MutableLiveData
import com.app.mvvmkotlindemo.bean.*
import com.everyline.baselibrary.base.viewmodel.BaseViewModel
import com.everyline.baselibrary.ext.request
import com.everyline.baselibrary.state.ResultState
import com.app.mvvmkotlindemo.network.HttpRequestManger
import okhttp3.RequestBody

/**
 * Created by on 2021/1/21.
 * 天天挂线
 *  746608431@qq.com
 *  描述:TODO
 */

class RequestDataUploadModel : BaseViewModel() {
    var headImgBeanData = MutableLiveData<ResultState<ImgBean?>>()
    var idCardPicAData = MutableLiveData<ResultState<ImgBean?>>()
    var idCardPicBData = MutableLiveData<ResultState<ImgBean?>>()
    var driverCardPicAData = MutableLiveData<ResultState<ImgBean?>>()
    var driverCardPicBData = MutableLiveData<ResultState<ImgBean?>>()
    var ncdPicAData = MutableLiveData<ResultState<ImgBean?>>()
    var ncdPicBData = MutableLiveData<ResultState<ImgBean?>>()

    var vehicleCardPicAData = MutableLiveData<ResultState<ImgBean?>>()
    var vehicleCardPicBData = MutableLiveData<ResultState<ImgBean?>>()
    var vehicleCardPicCData = MutableLiveData<ResultState<ImgBean?>>()

    var opCertPicAData = MutableLiveData<ResultState<ImgBean?>>()
    var opCertPicBData = MutableLiveData<ResultState<ImgBean?>>()
    var carPicData = MutableLiveData<ResultState<ImgBean?>>()

    var cinsPicData = MutableLiveData<ResultState<ImgBean?>>()
    var rinsPicData = MutableLiveData<ResultState<ImgBean?>>()
    var binsPicData = MutableLiveData<ResultState<ImgBean?>>()


    var getZcOpenAreaData =
        MutableLiveData<ResultState<MutableList<ZcOpenAreaBean>?>>()

    var openAreaData =
        MutableLiveData<ResultState<MutableList<OpenAreaBean>?>>()
    var openAreaData2 =
        MutableLiveData<ResultState<MutableList<OpenAreaBean>?>>()


    var carColorData = MutableLiveData<ResultState<MutableList<CarColorBean>?>>()

    var BankListData = MutableLiveData<ResultState<MutableList<BankListBean>?>>()
    var areaAllListData = MutableLiveData<ResultState<MutableList<AreaAllBean>?>>()
    var addAuditData = MutableLiveData<ResultState<UploadAuditBean?>>()
    var addTempAuditData = MutableLiveData<ResultState<UploadAuditBean?>>()
    var UploadAuditBeanData = MutableLiveData<ResultState<AddAuditBean?>>()


    fun getZcDriverBaseInfo() {
        request({ HttpRequestManger.apiService.getZcDriverBaseInfo() }, UploadAuditBeanData, true)
    }

    fun getZcOpenArea() {
        request({ HttpRequestManger.apiService.getZcOpenArea() }, getZcOpenAreaData, false)
    }

    fun findAllZcDepartmentByOpenArea(map: Map<String, String>) {
        request(
            { HttpRequestManger.apiService.findAllZcDepartmentByOpenArea(map) },
            openAreaData,
            false
        )
    }
    fun findAllZcDepartmentByOpenArea2(map: Map<String, String>) {
        request(
            { HttpRequestManger.apiService.findAllZcDepartmentByOpenArea(map) },
            openAreaData2,
            false
        )
    }

    fun addAudit(map: Map<String, String>) {
        request(
            { HttpRequestManger.apiService.addAudit(map) },
            addAuditData,
            true
        )
    }

    fun addTempAudit(map: Map<String, String>) {
        request(
            { HttpRequestManger.apiService.addTempAudit(map) },
            addTempAuditData,
            true
        )
    }


    fun findAllCarColor(validStr: String) {
        request({ HttpRequestManger.apiService.findAllCarColor(validStr) }, carColorData, true)
    }


    fun findAllBank(validStr: String) {
        request({ HttpRequestManger.apiService.findAllBank(validStr) }, BankListData, true)
    }

    fun findAllArea(validStr: String) {
        request({ HttpRequestManger.apiService.findAllArea(validStr) }, areaAllListData, true)
    }

    fun uploadHeadImgFile(params: Map<String, RequestBody>) {
        request({ HttpRequestManger.apiService.uploadFile(params) }, headImgBeanData, true)
    }

    fun uploadidCardPicA(params: Map<String, RequestBody>) {
        request({ HttpRequestManger.apiService.uploadFile(params) }, idCardPicAData, true)
    }

    fun uploadidCardPicB(params: Map<String, RequestBody>) {
        request({ HttpRequestManger.apiService.uploadFile(params) }, idCardPicBData, true)
    }

    fun uploaddriverCardPicA(params: Map<String, RequestBody>) {
        request({ HttpRequestManger.apiService.uploadFile(params) }, driverCardPicAData, true)
    }

    fun uploaddriverCardPicB(params: Map<String, RequestBody>) {
        request({ HttpRequestManger.apiService.uploadFile(params) }, driverCardPicBData, true)
    }

    fun uploadncdPicA(params: Map<String, RequestBody>) {
        request({ HttpRequestManger.apiService.uploadFile(params) }, ncdPicAData, true)
    }

    fun uploadncdPicB(params: Map<String, RequestBody>) {
        request({ HttpRequestManger.apiService.uploadFile(params) }, ncdPicBData, true)
    }

    fun uploadvehicleCardPicA(params: Map<String, RequestBody>) {
        request({ HttpRequestManger.apiService.uploadFile(params) }, vehicleCardPicAData, true)
    }

    fun uploadvehicleCardPicB(params: Map<String, RequestBody>) {
        request({ HttpRequestManger.apiService.uploadFile(params) }, vehicleCardPicBData, true)
    }

    fun uploadvehicleCardPicC(params: Map<String, RequestBody>) {
        request({ HttpRequestManger.apiService.uploadFile(params) }, vehicleCardPicCData, true)
    }

    fun uploadopCertPicA(params: Map<String, RequestBody>) {
        request({ HttpRequestManger.apiService.uploadFile(params) }, opCertPicAData, true)
    }

    fun uploadopCertPicB(params: Map<String, RequestBody>) {
        request({ HttpRequestManger.apiService.uploadFile(params) }, opCertPicBData, true)
    }

    fun uploadcarPic(params: Map<String, RequestBody>) {
        request({ HttpRequestManger.apiService.uploadFile(params) }, carPicData, true)
    }

    fun uploadcinsPic(params: Map<String, RequestBody>) {
        request({ HttpRequestManger.apiService.uploadFile(params) }, cinsPicData, true)
    }

    fun uploadrinsPic(params: Map<String, RequestBody>) {
        request({ HttpRequestManger.apiService.uploadFile(params) }, rinsPicData, true)
    }

    fun uploadbinsPic(params: Map<String, RequestBody>) {
        request({ HttpRequestManger.apiService.uploadFile(params) }, binsPicData, true)
    }

}